package com.manster.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.manster.service.*;
import com.manster.util.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.ServletRequestUtils;

import javax.servlet.http.HttpServletRequest;

/**
 * @Author manster
 * @Date 2022/3/13
 **/
public class BaseController {
    @Autowired
    HttpServletRequest req;

    @Autowired
    RedisUtils redisUtils;

    @Autowired
    SysUserService userService;

    @Autowired
    SysRoleService roleService;

    @Autowired
    SysMenuService menuService;

    @Autowired
    SysUserRoleService userRoleService;

    @Autowired
    SysRoleMenuService roleMenuService;

    public Page getPage(){
        int current = ServletRequestUtils.getIntParameter(req, "current", 1);
        int size = ServletRequestUtils.getIntParameter(req, "size", 10);
        return new Page(current,size);
    }
}
